﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace Pop
{
    class Player
    {
        int lives;
        int points;
        Pallet pallet;
        Texture2D avatar; // future implementation

        public Pallet oPallet
        {
            get { return pallet; }
           // set { position = value; }

        }

        

       public Player(int lives,Pallet pallet)
        {
            this.lives = lives;
            this.pallet = pallet;
        }

       public void increaseLives(int quantity,int maxLives)
       {
           if ((lives + quantity) > maxLives)
           {
               lives = maxLives;
           }
           else
           {
               lives += quantity;
           }
           
       }

       public bool decreaseLives(int quantity)
       {
           if ((lives - quantity) < 0)
           {
               lives = 0;
               return false;
           }
           else
           {
               lives -= quantity;
               return true;
           }

           
       }

       public void Draw(SpriteBatch spriteBatch, SpriteFont font)
       {
           pallet.Draw(spriteBatch);
           spriteBatch.DrawString(font, lives.ToString(), new Vector2(0,font.MeasureString(lives.ToString()).Y * 3), Color.Yellow);           
       }


    }
}
